function addLine(tableId, rowId, nameText, nameCB, value, checked){
	var table = document.getElementById(tableId);
	var rowCount = table.rows.length;
	
	var row = table.insertRow(rowCount);
	row.id=rowId;
	
	var cell1 = row.insertCell(0);
	var cell2 = row.insertCell(1);
	
	addSlot(cell1, cell2, nameText, nameCB, value, checked);
}

function addSlot(cell1, cell2, nameText, nameCB, value, checked) {
    var newInput = document.createElement("input");
    newInput.name = nameText;
    newInput.type = "text";
    newInput.value = value;
    

    var ch = document.createElement("input");
    ch.type = "checkbox";
    ch.name = nameCB;
    if (checked){
    	ch.checked = checked;
    }
    
    cell1.appendChild(newInput);
    cell2.appendChild(ch);
}

function removeElement(id) {
	var element = document.getElementById(id);
	element.parentNode.removeChild(element);
}